﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using BaseData.Common;
using BaseData.UI;
using TaxData.House;
using TaxEntity.House;
using TaxEntity.User;

namespace TaxBiz.House
{
    /// <summary>
    /// 房产信息逻辑层
    /// </summary>
    public class HouseInfoBiz
    {
        private HouseInfoData hid = new HouseInfoData();

        /// <summary>
        /// 获取房产信息实体
        /// </summary>
        public HouseInfoEntity GetEntityById(long ID)
        {
            HouseInfoEntity model = hid.GetEntityById(ID);
            return model;
        }

        /// <summary>
        /// 获取房产信息实体
        /// </summary>
        public HouseInfoEntity GetEntityByCertificateID(string CertificateID)
        {
            HouseInfoEntity model = hid.GetEntityByCertificateID(CertificateID);
            return model;
        }

        /// <summary>
        /// 删除房产
        /// </summary>
        public bool Delete(long ID, UserEntity optUser)
        {
            bool isSucc = hid.Delete(ID);
            return isSucc;
        }

        /// <summary>
        /// 获取房产列表
        /// </summary>
        public DataTable GetList(string strWhere, int pageSize, int page, ref int allCount)
        {
            DataTable dt = hid.GetList(strWhere, pageSize, page, ref allCount);
            return dt;
        }

        /// <summary>
        /// 增加房产
        /// </summary>
        /// <param name="model">房产信息实体</param>
        /// <returns>成功房产编号,失败返回0</returns>
        public long Add(HouseInfoEntity model, UserEntity optUser)
        {
            long id = hid.Add(model);
            return id;
        }

        /// <summary>
        /// 修改房产信息
        /// </summary>
        /// <param name="model">修改房产</param>
        /// <returns>操作结果</returns>
        public bool Update(HouseInfoEntity model, UserEntity optUser)
        {
            bool isSucc = hid.Update(model);
            return isSucc;
        }
    }
}
